const commentreducer = (state = [], action) => {
    if (action.type == 'GET_COMM') {
        console.log(action.value)
        return action.value.reverse()
    } else if (action.type == 'ADD_COMM') {
        return [ action.value,...state]
    }
    else if (action.type == 'DEL_COMM') {
        console.log(action.value)
        let arr
        arr = [...state].filter((item) => {
            return item.comment_id != action.value
        })
        return arr
    } else
    return state;
}

export default commentreducer